.class public Lcom/waiqin365/lightwork/tracker/c/a;
.super Ljava/lang/Object;


# direct methods
.method public static a(I)Lcom/waiqin365/lightwork/tracker/c/a/d;
    .locals 1

    packed-switch p0, :pswitch_data_0

    const/4 v0, 0x0

    :goto_0
    return-object v0

    :pswitch_0
    new-instance v0, Lcom/waiqin365/lightwork/tracker/c/a/c;

    invoke-direct {v0}, Lcom/waiqin365/lightwork/tracker/c/a/c;-><init>()V

    goto :goto_0

    nop

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
    .end packed-switch
.end method

.method public static a(Lcom/waiqin365/lightwork/tracker/c/a/b;)Lcom/waiqin365/lightwork/tracker/c/a/d;
    .locals 8

    const/4 v2, 0x0

    const-string/jumbo v0, ""

    const-string/jumbo v0, ""

    :try_start_0
    invoke-static {}, Lcom/waiqin365/lightwork/tracker/c/a;->a()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {p0}, Lcom/waiqin365/lightwork/tracker/c/a/b;->a()I
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    move-result v0

    const/4 v1, 0x1

    if-ne v0, v1, :cond_3

    :try_start_1
    invoke-virtual {p0}, Lcom/waiqin365/lightwork/tracker/c/a/b;->c()Ljava/lang/String;

    move-result-object v0

    new-instance v5, Ljava/io/ByteArrayInputStream;

    const-string/jumbo v1, "UTF-8"

    invoke-virtual {v0, v1}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B

    move-result-object v0

    invoke-direct {v5, v0}, Ljava/io/ByteArrayInputStream;-><init>([B)V
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_2
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    :try_start_2
    new-instance v4, Ljava/io/BufferedInputStream;

    invoke-direct {v4, v5}, Ljava/io/BufferedInputStream;-><init>(Ljava/io/InputStream;)V
    :try_end_2
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_3
    .catchall {:try_start_2 .. :try_end_2} :catchall_1

    :try_start_3
    new-instance v3, Ljava/io/ByteArrayOutputStream;

    invoke-virtual {v4}, Ljava/io/BufferedInputStream;->available()I

    move-result v0

    invoke-direct {v3, v0}, Ljava/io/ByteArrayOutputStream;-><init>(I)V
    :try_end_3
    .catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_4
    .catchall {:try_start_3 .. :try_end_3} :catchall_2

    :try_start_4
    new-instance v1, Ljava/util/zip/GZIPOutputStream;

    invoke-direct {v1, v3}, Ljava/util/zip/GZIPOutputStream;-><init>(Ljava/io/OutputStream;)V
    :try_end_4
    .catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_5
    .catchall {:try_start_4 .. :try_end_4} :catchall_3

    :goto_0
    :try_start_5
    invoke-virtual {v4}, Ljava/io/BufferedInputStream;->read()I

    move-result v0

    const/4 v7, -0x1

    if-eq v0, v7, :cond_4

    invoke-virtual {v1, v0}, Ljava/util/zip/GZIPOutputStream;->write(I)V
    :try_end_5
    .catch Ljava/io/IOException; {:try_start_5 .. :try_end_5} :catch_0
    .catchall {:try_start_5 .. :try_end_5} :catchall_4

    goto :goto_0

    :catch_0
    move-exception v0

    :goto_1
    :try_start_6
    invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V
    :try_end_6
    .catchall {:try_start_6 .. :try_end_6} :catchall_4

    if-eqz v1, :cond_0

    :try_start_7
    invoke-virtual {v1}, Ljava/util/zip/GZIPOutputStream;->close()V

    :cond_0
    if-eqz v3, :cond_1

    invoke-virtual {v3}, Ljava/io/ByteArrayOutputStream;->close()V

    :cond_1
    if-eqz v4, :cond_2

    invoke-virtual {v4}, Ljava/io/BufferedInputStream;->close()V

    :cond_2
    if-eqz v5, :cond_3

    invoke-virtual {v5}, Ljava/io/ByteArrayInputStream;->close()V

    :cond_3
    :goto_2
    invoke-virtual {p0}, Lcom/waiqin365/lightwork/tracker/c/a/b;->b()Ljava/util/HashMap;

    move-result-object v0

    invoke-static {v6, v0, v2}, Lcom/waiqin365/compons/b/a;->a(Ljava/lang/String;Ljava/util/HashMap;[B)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p0}, Lcom/waiqin365/lightwork/tracker/c/a/b;->a()I

    move-result v0

    invoke-static {v0}, Lcom/waiqin365/lightwork/tracker/c/a;->a(I)Lcom/waiqin365/lightwork/tracker/c/a/d;

    move-result-object v0

    invoke-virtual {v0, v1}, Lcom/waiqin365/lightwork/tracker/c/a/d;->a(Ljava/lang/String;)Z

    move-result v1

    invoke-virtual {v0, v1}, Lcom/waiqin365/lightwork/tracker/c/a/d;->a(Z)V
    :try_end_7
    .catch Ljava/lang/Exception; {:try_start_7 .. :try_end_7} :catch_1

    :goto_3
    return-object v0

    :cond_4
    :try_start_8
    invoke-virtual {v1}, Ljava/util/zip/GZIPOutputStream;->finish()V

    invoke-virtual {v3}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B
    :try_end_8
    .catch Ljava/io/IOException; {:try_start_8 .. :try_end_8} :catch_0
    .catchall {:try_start_8 .. :try_end_8} :catchall_4

    move-result-object v2

    if-eqz v1, :cond_5

    :try_start_9
    invoke-virtual {v1}, Ljava/util/zip/GZIPOutputStream;->close()V

    :cond_5
    if-eqz v3, :cond_6

    invoke-virtual {v3}, Ljava/io/ByteArrayOutputStream;->close()V

    :cond_6
    if-eqz v4, :cond_7

    invoke-virtual {v4}, Ljava/io/BufferedInputStream;->close()V

    :cond_7
    if-eqz v5, :cond_3

    invoke-virtual {v5}, Ljava/io/ByteArrayInputStream;->close()V
    :try_end_9
    .catch Ljava/lang/Exception; {:try_start_9 .. :try_end_9} :catch_1

    goto :goto_2

    :catch_1
    move-exception v0

    invoke-virtual {p0}, Lcom/waiqin365/lightwork/tracker/c/a/b;->a()I

    move-result v0

    invoke-static {v0}, Lcom/waiqin365/lightwork/tracker/c/a;->a(I)Lcom/waiqin365/lightwork/tracker/c/a/d;

    move-result-object v0

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/waiqin365/lightwork/tracker/c/a/d;->a(Z)V

    goto :goto_3

    :catchall_0
    move-exception v0

    move-object v3, v2

    move-object v4, v2

    move-object v5, v2

    :goto_4
    if-eqz v2, :cond_8

    :try_start_a
    invoke-virtual {v2}, Ljava/util/zip/GZIPOutputStream;->close()V

    :cond_8
    if-eqz v3, :cond_9

    invoke-virtual {v3}, Ljava/io/ByteArrayOutputStream;->close()V

    :cond_9
    if-eqz v4, :cond_a

    invoke-virtual {v4}, Ljava/io/BufferedInputStream;->close()V

    :cond_a
    if-eqz v5, :cond_b

    invoke-virtual {v5}, Ljava/io/ByteArrayInputStream;->close()V

    :cond_b
    throw v0
    :try_end_a
    .catch Ljava/lang/Exception; {:try_start_a .. :try_end_a} :catch_1

    :catchall_1
    move-exception v0

    move-object v3, v2

    move-object v4, v2

    goto :goto_4

    :catchall_2
    move-exception v0

    move-object v3, v2

    goto :goto_4

    :catchall_3
    move-exception v0

    goto :goto_4

    :catchall_4
    move-exception v0

    move-object v2, v1

    goto :goto_4

    :catch_2
    move-exception v0

    move-object v1, v2

    move-object v3, v2

    move-object v4, v2

    move-object v5, v2

    goto/16 :goto_1

    :catch_3
    move-exception v0

    move-object v1, v2

    move-object v3, v2

    move-object v4, v2

    goto/16 :goto_1

    :catch_4
    move-exception v0

    move-object v1, v2

    move-object v3, v2

    goto/16 :goto_1

    :catch_5
    move-exception v0

    move-object v1, v2

    goto/16 :goto_1
.end method

.method private static a()Ljava/lang/String;
    .locals 4

    const-string/jumbo v0, "%s%s"

    const/4 v1, 0x2

    new-array v1, v1, [Ljava/lang/Object;

    const/4 v2, 0x0

    invoke-static {}, Lcom/fiberhome/gaea/client/c/b;->d()Ljava/lang/String;

    move-result-object v3

    aput-object v3, v1, v2

    const/4 v2, 0x1

    const-string/jumbo v3, "/services/trackService"

    aput-object v3, v1, v2

    invoke-static {v0, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method
